<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <style>
        .mine{ padding:  0; }
        .content{width: 100%}
        .top{padding: 45px 0;display: flex;justify-content: space-between;align-items: center;background-color:  #FABB3E;}
        .person{display: flex;align-items: center;margin-left: 20px}
        .person img.default{width: 70px;height: 70px;margin-right: 10px}
        .person .message{display: flex;flex-direction: column;justify-content: space-around;}
        .person .message .notLogin{font-size: 18px;color: #fff;font-weight: 500}
        .person .message .loginmessage{font-size: 13px;color: #fff;}
        .top .resume{padding: 9px 18px;background-color:  #FADB8B;border-top-left-radius: 30px;border-bottom-left-radius: 30px;color: #555;font-size: 13px;flex-shrink: 0}
        .box{padding: 0 15px;margin-top: -30px}
        .wrap{padding: 10px 0;background-color: #fff;box-shadow: 0 0 9px 0 rgba(85,85,85,0.15);border-radius: 15px;display: flex;justify-content: space-around;align-items: center;}
        .wrap .item{display: flex;flex-direction: column;justify-content: space-around;align-items: center;}
        .item img.all{width: 19px;height: 16px;margin-bottom: 7px}
        .item img.applied,.item img.inter,.item img.work{width: 18px;height: 17px;margin-bottom: 7px}
        .item span{font-size: 12px;color: #000;}
        .list{padding: 30px 0 0 20px;}
        .list .listbox{display: flex;justify-content: space-around;align-items: center;border-bottom: 1px solid #e5e5e5;padding-bottom: 18px;margin-bottom: 18px}
        .list .listbox:last-child{border-bottom: none}
        .list .listbox img{margin-right: 16px}
        .list .listbox img.more{margin-right: 20px;width: 6px;height: 10px;}
        .list .listbox span.title{color: #000;flex: 2}
        .list .listbox img.send{width: 17px;height: 22px;}
        .list .listbox img.job{width: 17px;height: 17px;}
        .list .listbox img.contactUs,.list .listbox img.feedback{width: 17px;height: 19px;}
        .list .listbox img.setting,.list .listbox img.aboutUs{width: 17px;height: 18px;}

    </style>
</head>
<body>
    <div class="mine">
      <div class="content">
        <div class="top">
          <div class="person">
            <img src="../image/defaults.png" class="default">
            <div class="message">
              <span class="notLogin"></span>
              <span class="loginmessage line1"></span>
            </div>
          </div>
          <div class="resume">在线简历</div>
        </div>
        <div class="box">
          <div class="wrap">
            <div class="item">
              <img src="../image/all.png" class="all">
              <span>全部</span>
            </div>
            <div class="item">
              <img src="../image/applied.png" class="applied">
              <span>已报名</span>
            </div>
            <div class="item">
              <img src="../image/inter.png" class="inter">
              <span>已通过</span>
            </div>
            <div class="item">
              <img src="../image/work.png" class="work">
              <span>已工作</span>
            </div>
          </div>
        </div>
        <div class="list">
          <div class="listbox" id="send">
            <img src="../image/send.png" class="send">
            <span class="title">我的投递</span>
            <img src="../image/more.png" class="more">
          </div>
          <div class="listbox" id="job">
            <img src="../image/job.png" class="job">
            <span class="title">职位收藏</span>
            <img src="../image/more.png" class="more">
          </div>
          <div class="listbox" id="contactUs">
            <img src="../image/contactUs.png" class="contactUs">
            <span class="title">联系我们</span>
            <img src="../image/more.png" class="more">
          </div>
          <div class="listbox" id="aboutUs">
            <img src="../image/aboutUs.png" class="aboutUs">
            <span class="title">关于我们</span>
            <img src="../image/more.png" class="more">
          </div>
          <div class="listbox" id="feedback">
            <img src="../image/feedback.png" class="feedback">
            <span class="title">意见反馈</span>
            <img src="../image/more.png" class="more">
          </div>
          <div class="listbox" id="setting">
            <img src="../image/setting.png" class="setting">
            <span class="title">设置</span>
            <img src="../image/more.png" class="more">
          </div>
        </div>
      </div>
    </div>
</body>
</html>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/encrypt.js"></script>
<script type="text/javascript">
  apiready = function () {
    var base = new Base64();
    var userid = $api.getStorage('userID');

    if(userid){

      var json = {'userID':userid}
      var parameter = base.encode(JSON.stringify(json));
      var signValue = parameter + secretKey
      var sign = signValue.MD5(32)
      $api.post(url+'getUserResumeInfo.ashx', {values:{parameter:parameter,sign:sign}}, function(ret){

        if(ret.code == 200){
          $api.html($api.dom('.notLogin'), ret.data.name);

          if(ret.data.selfDesc){

            $api.html($api.dom('.loginmessage'), ret.data.selfDesc);
          }else{
            $api.html($api.dom('.loginmessage'), '添加自我评价更容易获得青睐');

          }

        }else{

          $api.html($api.dom('.notLogin'), '编辑信息');
          $api.html($api.dom('.loginmessage'), '添加自我评价更容易获得青睐');
        }
      })
    }else{
      $api.html($api.dom('.notLogin'), '未登录');
      $api.html($api.dom('.loginmessage'), '登录后才能报名');
      $api.addEvt($api.dom('.person'), 'click', function(){//登录

        api.openWin({
          name: 'login',
          url: './login.html'
        });

      });
    }


    $api.addEvt($api.dom('.resume'), 'click', function(){//在线简历
      login(function(){

        api.openWin({
          name: 'resume',
          url: './resume.html'
        });
      })

    });
    $api.addEvt($api.dom('.all'), 'click', function(){//全部
      login(function(){

        api.openWin({
          name: 'send',
          url: './send.html',
          pageParam:{
            num:0
          }
        });
      })

    });
    $api.addEvt($api.dom('.applied'), 'click', function(){//已报名
      login(function(){

        api.openWin({
          name: 'send',
          url: './send.html',
          pageParam:{
            num:1
          }
        });
      })

    });
    $api.addEvt($api.dom('.inter'), 'click', function(){//待面试
      login(function(){

        api.openWin({
          name: 'send',
          url: './send.html',
          pageParam:{
            num:2
          }
        });
      })

    });
    $api.addEvt($api.dom('.work'), 'click', function(){//已上岗
      login(function(){
        api.openWin({
          name: 'send',
          url: './send.html',
          pageParam:{
            num:3
          }
        });

      })

    });
    $api.addEvt($api.dom('#send'), 'click', function(){//我的投递
      login(function(){

        api.openWin({
          name: 'send',
          url: './send.html',
          pageParam:{
            num:0
          }
        });
      })
    });
    $api.addEvt($api.dom('#job'), 'click', function(){//职位收藏
      login(function(){

        api.openWin({
          name: 'job',
          url: './job.html'
        });
      })
    });
    $api.addEvt($api.dom('#contactUs'), 'click', function(){//联系我们
      api.openWin({
          name: 'contactUs',
          url: './contactUs.html'
      });
    });

    $api.addEvt($api.dom('#aboutUs'), 'click', function(){//关于我们
      api.openWin({
          name: 'aboutUs',
          url: './aboutUs.html'
      });

    });
    $api.addEvt($api.dom('#feedback'), 'click', function(){//意见反馈

      api.openWin({
          name: 'feedback',
          url: './feedback.html'
      });

    });
    $api.addEvt($api.dom('#setting'), 'click', function(){//设置
      login(function(){

        api.openWin({
          name: 'setting',
          url: './setting.html'
        });
      })

    });

    function login(fun){
      if(userid == undefined){
        api.openWin({
          name: 'login',
          url: './login.html'
        });
      }else{
        fun && fun()
      }

    }
  }
  function funcGoto(){
    window.location.reload()
  }

</script>
